#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>

int main(int argc,char const *argv[])
{
    pid_t pid = fork();
    if (pid > 0 )
    {
        printf("父进程 %d\n",getpid());
    }else if (pid == 0)
    {
        printf("子进程 %d\n",getpid());
        char *path = "/home/fzl_admin/Linux_ceshi/linux_app/3_PROC/hello";
        char *args[]={"hello","cheshi",NULL};\
        char *env[] = {NULL};
        int ret = execve(path,args,env);
        if (ret == -1)//execve 执行失败
        {
           perror("execve 执行失败");
           _exit(EXIT_FAILURE);
        }
        
    }
    return 0 ;
}